import com.dao.ManagersDao;
import com.pojo.Managers;
import com.util.MyBatisUtil;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.junit.Before;
import org.junit.Test;

import java.io.IOException;
import java.io.InputStream;
import java.util.List;

public class MyBatisORM {

    @Test
    public void findAll(){
        //调用工具类方法
        ManagersDao managersDao = MyBatisUtil.getMapper(ManagersDao.class);

        List<Managers> managers = managersDao.findAll();

        for (Managers manager : managers) {
            System.out.println(manager);
        }
    }

}
